Project Euler Problem 7 Python Solution